<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<form id="f1" method="post" th:action="@{/emp}" th:object="${emp}">
    <h1 th:if="${emp.id == null}">新增员工</h1>
    <div th:if="${emp.id != null}">
        <h1>修改员工</h1>
        <input type="hidden" th:field="*{id}">
        <input type="hidden" name="_method" value="PUT">
    </div>
    <p>
        姓名:<input type="text" th:field="*{name}"/>
    </p>
    <p>
        性别:<span th:each="sex:${sexs}">
                <input type="radio" th:field="*{sex}" th:value="${sex.key}"/>
                <span th:text="${sex.value}"></span>
            </span>
    </p>
    <p>
        工资:<input type="text" th:field="*{sal}"/>
    </p>
    <p>
        职位:<input type="text" th:field="*{jobDesc}"/>
    </p>
    <p>
        出生日期:<input type="date" th:field="*{birthday}"/>
    </p>
    <p>
        <button>保存</button>
    </p>
</form>
</body>
</html>